package com.financial.service.sysconfig.controller;

import com.financial.service.sysconfig.domain.FinancialSysconfigKeyinfoDO;
import com.financial.service.sysconfig.service.FinancialSysconfigKeyinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;

/**
 * 金融中心键值信息表
 *
 * @author WANGNING
 * @email wyn20140226@aliyun.com
 * @date 2019-11-12 14:16:25
 */

@RestController
@RequestMapping("/sysconfig")
public class FinancialSysconfigKeyinfoController {
    @Autowired
    private FinancialSysconfigKeyinfoService financialSysconfigKeyinfoService;

    /**
     * 获取银盛微信支付业务参数配置
     * @return String
     */
    @GetMapping("/business/ys/pay/wechat")
    public String getBusinessYsPayWechat(){
        Map<String, Object> map = new HashMap<>();
        map.put("infoKind", "ys_business_pay");
        map.put("infoKey", "ys_pay_wechat");
        FinancialSysconfigKeyinfoDO financialSysconfigKeyinfoDO =financialSysconfigKeyinfoService.queryValue(map);
        return financialSysconfigKeyinfoDO.getInfoValue();
    }

    /**
     * 获取银盛服务参数配置
     * @return String
     */
    @GetMapping("/service/ys/config")
    public String getServiceYsConfig(){
        Map<String, Object> map = new HashMap<>();
        map.put("infoKind", "ys_service_config");
        map.put("infoKey", "ys_service_config");
        FinancialSysconfigKeyinfoDO financialSysconfigKeyinfoDO =financialSysconfigKeyinfoService.queryValue(map);
        return financialSysconfigKeyinfoDO.getInfoValue();
    }
    /**
     * 获取银盛支付宝支付业务参数配置
     * @return String
     */
    @GetMapping("/business/ys/pay/alipay")
    public String getBusinessYsPayAliPay(){
        Map<String, Object> map = new HashMap<>();
        map.put("infoKind", "ys_business_pay");
        map.put("infoKey", "ys_pay_alipay");
        FinancialSysconfigKeyinfoDO financialSysconfigKeyinfoDO =financialSysconfigKeyinfoService.queryValue(map);
        return financialSysconfigKeyinfoDO.getInfoValue();
    }

    /**
     * 获取汇收银服务参数配置
     * @return String
     */
    @GetMapping("/service/Heemoney/config")
    public String getServiceHeemoneyConfig(){
        Map<String, Object> map = new HashMap<>();
        map.put("infoKind", "heemoney_service_config");
        map.put("infoKey", "heemoney_service_config");
        FinancialSysconfigKeyinfoDO financialSysconfigKeyinfoDO =financialSysconfigKeyinfoService.queryValue(map);
        return financialSysconfigKeyinfoDO.getInfoValue();
    }
}
